package com.handinglian.ai.system.enums;

public enum RememberMeEnum {
    OFF(0,"关闭"),
    ON(1,"开启");

    public static RememberMeEnum valueOfOrdinal(Integer ordinal) {
        return ordinal == null || ordinal >= values().length ? null : values()[ordinal];
    }
    public static RememberMeEnum valueOfDesc(String desc) {
        for(RememberMeEnum rememberMeEnum : RememberMeEnum.values()){
            if(desc.equals(rememberMeEnum.getDescription())){
                return rememberMeEnum;
            }
        }
        return null;
    }
    public static RememberMeEnum valueOfKey(Integer key){
        for(RememberMeEnum rememberMeEnum : RememberMeEnum.values()){
            if(rememberMeEnum.getKey()==key){
                return rememberMeEnum;
            }
        }
        return null;
    }
    private final Integer key;
    private final String description;

    RememberMeEnum(Integer key, String description) {
        this.key = key;
        this.description = description;
    }

    public Integer getKey() {
        return key;
    }
    public String getDescription() {
        return this.description;
    }
}
